#include "UiNaviPathSwitch.h"
#ifdef MERGER_APP_TO_SHELL
	extern HINSTANCE g_SDHResModuleHandle;
#endif
UiNaviPathSwitchWnd::UiNaviPathSwitchWnd()
{
}

UiNaviPathSwitchWnd::~UiNaviPathSwitchWnd()
{
}

BOOL UiNaviPathSwitchWnd::InitUiWin(void)
{
	BOOL bRtn = FALSE;
	LoadiInterItem();
	return bRtn;
}

void UiNaviPathSwitchWnd::PaintWin(HDC hdc, RECT* prcWin, RECT* prcUpdate)
{
	m_NaviPathWndBG->Draw(hdc, prcWin, false, false);
}

int UiNaviPathSwitchWnd::OnLButtonDown(UINT fwKeys, int xPos, int yPos)
{
	return UiWin::OnLButtonDown(fwKeys, xPos, yPos);

}

int UiNaviPathSwitchWnd::OnLButtonUp(UINT fwKeys, int xPos, int yPos)
{
	return UiWin::OnLButtonUp(fwKeys, xPos, yPos);

}

void UiNaviPathSwitchWnd::LoadiInterItem()
{
//jdhuang 20120818
	
#ifndef MERGER_APP_TO_SHELL
	m_NaviPathWndBG = ImagingHelper::GetImageObject(MzGetInstanceHandle(), 1058);
#else
	m_NaviPathWndBG = ImagingHelper::GetImageObject(g_SDHResModuleHandle, 9007);
#endif
	RECT rtBtnNaviPathWnd[MAX_NAVIPATH_WND_BTN] = 
	{
//		55, 30, 149, 124,
		105, 160, 199, 254,
//		55, 290, 149, 384,
	};
	
	m_BtnNaviPathWnd[NAVIPATH_WND_FILE].SetPos(rtBtnNaviPathWnd[NAVIPATH_WND_FILE].left, rtBtnNaviPathWnd[NAVIPATH_WND_FILE].top,
					rtBtnNaviPathWnd[NAVIPATH_WND_FILE].right-rtBtnNaviPathWnd[NAVIPATH_WND_FILE].left,
					rtBtnNaviPathWnd[NAVIPATH_WND_FILE].bottom-rtBtnNaviPathWnd[NAVIPATH_WND_FILE].top);
	m_BtnNaviPathWnd[NAVIPATH_WND_FILE].SetID(8100);
#ifndef MERGER_APP_TO_SHELL
	m_BtnNaviPathWnd[NAVIPATH_WND_FILE].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1002, true));
	m_BtnNaviPathWnd[NAVIPATH_WND_FILE].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1003, true));
#else
	m_BtnNaviPathWnd[NAVIPATH_WND_FILE].SetNormalImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,9008, true));
	m_BtnNaviPathWnd[NAVIPATH_WND_FILE].SetPressedImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,9009, true));
#endif
	AddChild(&m_BtnNaviPathWnd[NAVIPATH_WND_FILE]);
/*
	m_BtnNaviPathWnd[NAVIPATH_WND_NEXT].SetPos(rtBtnNaviPathWnd[NAVIPATH_WND_NEXT].left, rtBtnNaviPathWnd[NAVIPATH_WND_NEXT].top,
					rtBtnNaviPathWnd[NAVIPATH_WND_NEXT].right-rtBtnNaviPathWnd[NAVIPATH_WND_NEXT].left,
					rtBtnNaviPathWnd[NAVIPATH_WND_NEXT].bottom-rtBtnNaviPathWnd[NAVIPATH_WND_NEXT].top);
	m_BtnNaviPathWnd[NAVIPATH_WND_NEXT].SetID(8101);
#ifndef MERGER_APP_TO_SHELL
	m_BtnNaviPathWnd[NAVIPATH_WND_NEXT].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1004, true));
	m_BtnNaviPathWnd[NAVIPATH_WND_NEXT].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1005, true));
#else
	m_BtnNaviPathWnd[NAVIPATH_WND_NEXT].SetNormalImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,9005, true));
	m_BtnNaviPathWnd[NAVIPATH_WND_NEXT].SetPressedImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,9006, true));
#endif
	AddChild(&m_BtnNaviPathWnd[NAVIPATH_WND_NEXT]);

	m_BtnNaviPathWnd[NAVIPATH_WND_LAST].SetPos(rtBtnNaviPathWnd[NAVIPATH_WND_LAST].left, rtBtnNaviPathWnd[NAVIPATH_WND_LAST].top,
					rtBtnNaviPathWnd[NAVIPATH_WND_LAST].right-rtBtnNaviPathWnd[NAVIPATH_WND_LAST].left,
					rtBtnNaviPathWnd[NAVIPATH_WND_LAST].bottom-rtBtnNaviPathWnd[NAVIPATH_WND_LAST].top);
	m_BtnNaviPathWnd[NAVIPATH_WND_LAST].SetID(8102);
#ifndef MERGER_APP_TO_SHELL
	m_BtnNaviPathWnd[NAVIPATH_WND_LAST].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1006, true));
	m_BtnNaviPathWnd[NAVIPATH_WND_LAST].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1007, true));
#else
	m_BtnNaviPathWnd[NAVIPATH_WND_LAST].SetNormalImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,9001, true));
	m_BtnNaviPathWnd[NAVIPATH_WND_LAST].SetPressedImage(ImagingHelper::GetImageObject(g_SDHResModuleHandle,9002, true));
#endif
	AddChild(&m_BtnNaviPathWnd[NAVIPATH_WND_LAST]);
*/

}

BOOL UiNaviPathSwitchWnd::InitImages()
{
	return TRUE;
}
void UiNaviPathSwitchWnd::DeleteImages()
{
	m_NaviPathWndBG->UnloadImage();
}